<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    .cvs{
      border: solid 1px black;
    }
  </style>
</head>
<body>
  <canvas class="cvs"></canvas>
</body>
<script>
  const cvs = document.querySelector(".cvs");
  cvs.width = 400;
  cvs.height = 400;

  const ctx = cvs.getContext("2d");

  let now = 0;

  setInterval(()=>{
    ctx.clearRect(0,0,cvs.width,cvs.height)
    ctx.save();
    ctx.translate(200, 200);
    ctx.rotate( now += 0.1 );
    ctx.moveTo(0, 0);
    ctx.lineTo(100, 0);
    ctx.stroke();
    ctx.restore();
    
    ctx.beginPath();
    ctx.arc(200, 200, 5, 0, 2*Math.PI);
    ctx.fill();
  }, 1000);

  // 思考：机械时钟的实现

</script>
</html>